package com.ruoyi.buss.group.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.buss.group.mapper.DataCustomerGroupMapper;
import com.ruoyi.buss.group.domain.DataCustomerGroup;
import com.ruoyi.buss.group.service.IDataCustomerGroupService;

/**
 * 客户群体配置Service业务层处理
 * 
 * @author sxy
 * @date 2021-07-16
 */
@Service
public class DataCustomerGroupServiceImpl implements IDataCustomerGroupService 
{
    @Autowired
    private DataCustomerGroupMapper dataCustomerGroupMapper;

    /**
     * 查询客户群体配置
     * 
     * @param groupCode 客户群体配置ID
     * @return 客户群体配置
     */
    @Override
    public DataCustomerGroup selectDataCustomerGroupById(String groupCode)
    {
        return dataCustomerGroupMapper.selectDataCustomerGroupById(groupCode);
    }

    /**
     * 查询客户群体配置列表
     * 
     * @param dataCustomerGroup 客户群体配置
     * @return 客户群体配置
     */
    @Override
    public List<DataCustomerGroup> selectDataCustomerGroupList(DataCustomerGroup dataCustomerGroup)
    {
        return dataCustomerGroupMapper.selectDataCustomerGroupList(dataCustomerGroup);
    }

    /**
     * 新增客户群体配置
     * 
     * @param dataCustomerGroup 客户群体配置
     * @return 结果
     */
    @Override
    public int insertDataCustomerGroup(DataCustomerGroup dataCustomerGroup)
    {
        dataCustomerGroup.setCreateTime(DateUtils.getNowDate());
        return dataCustomerGroupMapper.insertDataCustomerGroup(dataCustomerGroup);
    }

    /**
     * 修改客户群体配置
     * 
     * @param dataCustomerGroup 客户群体配置
     * @return 结果
     */
    @Override
    public int updateDataCustomerGroup(DataCustomerGroup dataCustomerGroup)
    {
        dataCustomerGroup.setUpdateTime(DateUtils.getNowDate());
        return dataCustomerGroupMapper.updateDataCustomerGroup(dataCustomerGroup);
    }

    /**
     * 批量删除客户群体配置
     * 
     * @param groupCodes 需要删除的客户群体配置ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerGroupByIds(String[] groupCodes)
    {
        return dataCustomerGroupMapper.deleteDataCustomerGroupByIds(groupCodes);
    }

    /**
     * 删除客户群体配置信息
     * 
     * @param groupCode 客户群体配置ID
     * @return 结果
     */
    @Override
    public int deleteDataCustomerGroupById(String groupCode)
    {
        return dataCustomerGroupMapper.deleteDataCustomerGroupById(groupCode);
    }
}
